<template>
  <div class="recommend">
    <div class="wrap">
      <div class="rem-header">
        <div class="header-left">
          <img src="@/assets/img/hot.png" alt="" />
          <h2>热门兑换</h2>
        </div>
        <div class="header-right" @click="$router.push('/moreGoods?did=2')">
          <span>更多</span>
          <img src="@/assets/img/arrow.png" alt="" />
        </div>
      </div>
      <div class="hot-banner">
        <img src="@/assets/img/banner.4c6b6225.png" alt="" />
      </div>
      <ul class="rem-list">
        <Item v-for="item in hotList" :key="item.id" :data="item" />
      </ul>
    </div>
  </div>
</template>

<script>
import { HotAPI } from "@/request/api.js";
import Item from "@/components/index/Item.vue";
export default {
  data() {
    return {
      hotList: [],
    };
  },
  components: {
    Item,
  },
  props: {
    title: {
      type: String,
      default: "",
    },
  },
  async created() {
    let res = await HotAPI();
    this.hotList = res.data.data.data.records;
    // console.log(this.hotList);
  },
};
</script>

<style lang="less" scoped>
.recommend {
  padding-bottom: 45px;
  background: #f5f5f5;
  .rem-header {
    height: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: SourceHanSansSC;
    .header-left {
      display: flex;
      font-size: 30px;
      font-weight: bold;
      color: #242b39;
      h2 {
        margin-left: 20px;
      }
    }
    .header-right {
      display: flex;
      cursor: pointer;
      span {
        margin-right: 10px;
      }
    }
  }
  .hot-banner {
    margin-top: 20px;
  }
}
</style>